package com.jd.finance.core.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.jd.finance.core.pojo.entity.Notice;
import com.jd.finance.result.BaseResult;
import org.apache.ibatis.annotations.Param;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 公告表 服务类
 * </p>
 *
 * @author LiQingBo
 * @since 2022-05-19
 */
public interface NoticeService extends IService<Notice> {

    /**
     * 查询最新一条公告
     * @return
     */
    BaseResult getNewAnnounceTop();

    /**
     * 查询最新的六条公告
     * @return
     */
    BaseResult getNewSixAnnounce();

    /**
     * 查询关于我们
     * @return
     */
    BaseResult getAboutWe();



    /**
     * 查看所有公告
     * @param uid
     * @param page
     * @param limit
     * @return
     */
    BaseResult getAPPAllNotice(@Param("uid") Integer uid, @Param("page") Long page, @Param("limit") Long limit);

    /**
     * 根据公告id查询公告
     * @param uid
     * @param nid
     * @return
     */
    BaseResult getAPPNoticeById(@Param("uid") Integer uid, @Param("nid") Integer nid);

    /**
     * 根据公告id删除公告
     * @param uid
     * @param nid
     * @param request
     * @return
     */
    BaseResult deleteAPPNoticeById(@Param("uid") Integer uid, @Param("nid") Integer nid, @Param("request") HttpServletRequest request);

    /**
     * 添加新公告
     * @param uid
     * @param title
     * @param text
     * @return
     */
    BaseResult insertAPPNotice(@Param("uid") Integer uid, @Param("title") String title, @Param("text") String text,@Param("request") HttpServletRequest request);
}
